package com.java.designPattern;

public class SingletonOne {

    private SingletonOne() {
        System.out.println("这是一个私有构造函数");
    }

    //创建私有静态方法并实例化对象
    private static SingletonOne instance = new SingletonOne();
    //创建公有方法返回私有实例对象
    public static SingletonOne getInstance() {
        return instance;
    }
}
